﻿using System;
using System.Runtime.Serialization;
using System.Collections.Generic;

namespace TripLOA.WebService.Wrappers
{
    /// <summary>
    /// A serializable rapresentation of the Groupware.Message class
    /// </summary>
    [DataContract]
    public class Message
    {
        #region Costructors

        /// <summary>
        /// Parameterless Constructor
        /// </summary>
        public Message() { }

        /// <summary>
        /// Constructor. Set all fields to the values of the given Message object
        /// </summary>
        /// <param name="msg">A Groupware.Message object</param>
        public Message(Groupware.Message msg)
        {
            this.Id = msg.Id;
            this.IsRead = msg.IsRead;
            this.Priority = msg.Priority;
            this.Receiver = msg.Receiver;
            this.Sender = msg.Sender;
            this.Text = msg.Text;
            this.Title = msg.Title;
        }

        #endregion

        #region Properties
     
        [DataMember]
        public int Id { get; set; }

        [DataMember]
        public string Sender { get; set; }

        [DataMember]
        public List<string> Receiver { get; set; }

        [DataMember]
        public string Title { get; set; }

        [DataMember]
        public string Text { get; set; }

        [DataMember]
        public bool Priority { get; set; }

        [DataMember]
        public bool IsRead { get; set; }

        #endregion
    }
}
